cmake_minimum_required(VERSION 2.2)

project(Silk)
set(CMAKE_CXX_STANDARD 17)

set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")

include_directories(./compiler)
add_executable(${CMAKE_PROJECT_NAME} 
    "compiler/main.cpp" 
    "compiler/lexer/lexer.cpp" 
    "compiler/parser/parser.cpp" 
    "compiler/reader/reader.cpp"
)

add_custom_command(
    TARGET ${PROJECT_NAME} 
    POST_BUILD 
    COMMAND ${CMAKE_COMMAND} -E 
    copy_if_different  
        "${CMAKE_SOURCE_DIR}/compiler/test.silk"  
        "${CMAKE_BINARY_DIR}" 
)